package service;

import dao.StudentDao;
import dao.StudentDaoImpl;
import pojo.Student;

import java.sql.SQLException;
import java.util.List;

public class StudentServiceImpl implements StudentService{
    StudentDao studentDao = new StudentDaoImpl();
    @Override
    public List<Student> selectAll(String stuName,String stuNo,Integer sex,Integer pageIndex,Integer pageSize) throws SQLException {
        return studentDao.selectAll(stuName,stuNo,sex,pageIndex,pageSize);
    }

    @Override
    public int total(String stuName, String stuNo, Integer sex) throws SQLException {
        return studentDao.total(stuName,stuNo,sex);
    }

    @Override
    public int addStudent(Student student) {
        return studentDao.addStudent(student);
    }

    @Override
    public int updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public Student selectById(int stuId) {
        return studentDao.selectById(stuId);
    }

    @Override
    public int deleteById(int stuId) {
        return studentDao.deleteById(stuId);
    }

    @Override
    public Student selectByStuNo(String stuNo) {
        return studentDao.selectByStuNo(stuNo);
    }
}
